package com.wing.productionPlan.enumeration;

public enum TakeAuditEnumType {

    NOT_SEND("001", "未发"),
    OWE("002", "欠料"),
    FINISH("002", "完结");

    private final String code;
    private final String data;

    // 构造函数
    TakeAuditEnumType(String code, String data) {
        this.code = code;
        this.data = data;
    }

    // Getter 方法
    public String getCode() {
        return code;
    }

    public String getData() {
        return data;
    }

    // 通过code查找OperationType的方法
    public static TakeAuditEnumType getByCode(String code) {
        for (TakeAuditEnumType operation : values()) {
            if (operation.getCode().equals(code)) {
                return operation;
            }
        }
        throw new IllegalArgumentException("No matching operation for code: " + code);
    }

    // 可选：如果需要根据code获取data，可以提供此方法
    public static String getDataByCode(String code) {
        TakeAuditEnumType operation = getByCode(code);
        return operation.getData();
    }


}
